/*
Copyright DAUPHIN Maxime 2005

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
http://www.gnu.org/licenses/gpl.txt
*/
#include <sstream>
#include "MyWnd.h"
#include "resource.h"

MyWnd::MyWnd(void)
{
	m_windowName = "CopyAndPaste";
	m_wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1);
}

MyWnd::~MyWnd(void)
{
}

int MyWnd::onCreate()
{
	Gui::Wnd::onCreate();
	m_edit.create( this );
	m_clipBoard.create( this );
	return 0;
}

int MyWnd::onCommand(int command)
{
	switch ( command )
	{
	case ID_FILE_OPEN2 :
		MessageBox( m_hWnd, "Hello", "Hello", 0 );
		return 0;
	}
	return 0;
}

int MyWnd::onSize(int width, int height)
{
	Gui::Wnd::onSize(width,height);
	m_edit.move( 0, 0, width, height );

	return 0;
}

int MyWnd::onDrawClipBoard()
{
	std::string str = m_clipBoard.onDrawClipBoard();
	m_listStr.push_back( str );
	
	std::stringstream  visu;
	for ( itListStr it = m_listStr.begin(); it != m_listStr.end(); it++ )
	{
		visu << (*it) << Gui::Edit::endl;
	}
	m_edit.setText( visu.str().c_str() );

	return 0;
}
